Shadow tag memory to monitor state of cachelines at different cache level

ABSTRACT

A processing system includes a plurality of processor cores and a plurality of private caches. Each private cache is associated with a corresponding processor core of the plurality of processor cores and includes a corresponding first set of cachelines. The processing system further includes a shared cache shared by the plurality of processor cores. The shared cache includes a second set of cachelines, and a shadow tag memory including a plurality of entries, each entry storing state information for a corresponding cacheline of the first set of cachelines of one of the private caches.

BACKGROUND Description of the Related Art

Processing systems typically utilize data caching to accelerate accessto data stored in system memory. The data caching is implemented in theform of a cache hierarchy in which multiple levels of caches are used totemporarily store data accessed from the system memory. Coherencyprotocols often are implemented in such multiple level caches to ensurethat a processor core does not operate on cached data that has becomestale or otherwise invalid. However, in exclusive cachingimplementations (that is, where a valid cacheline is permitted to becached at only one level of the cacheline), conventional cachingtechniques often lead to excessive probe traffic for implementing thecoherency protocols, and thus may impact caching performance.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is better understood, and its numerous featuresand advantages made apparent to those skilled in the art by referencingthe accompanying drawings. The use of the same reference symbols indifferent drawings indicates similar or identical items.

FIG. 1 is a block diagram of a processing system utilizing a shadow tagmemory in accordance with some embodiments.

FIG. 2 is a block diagram of a level 3 (L3) cache with a shadow tagmemory for storing state information for level 2 (L2) caches inaccordance with some embodiments.

FIG. 3 is a flow diagram illustrating processes for implementing ashadow tag memory to improve caching performance in accordance with someembodiments.

FIG. 4 is a flow diagram illustrating a process for filtering cacheprobes using a shadow tag memory in accordance with some embodiments.

FIG. 5 is a diagram illustrating a process for coupled fill/victimrequests using a shadow tag memory in accordance with at least someembodiments.

FIG. 6 is a diagram illustrating an example utilization of a Forwardwith Exclusive (Fe) coherency state using a shadow tag memory inaccordance with some embodiments.

FIG. 7 is a diagram illustrating an example utilization of an OwnedDirty (Od) coherency state using a shadow tag memory in accordance withsome embodiments.

FIG. 8 is a flow diagram illustrating a process for evicting a cachelinefrom a cache hierarchy to a memory using a shadow tag memory inaccordance with some embodiments.

DETAILED DESCRIPTION

FIGS. 1-8 illustrate a processing system utilizing a shadow tag memoryto provide for efficient caching operations. The processing systemimplements one or more compute complexes, each compute complex havingmultiple processor cores and a cache hierarchy which has two or morelevels of caches. Each processor core is associated with one or morelevels of caches that are private to a corresponding core (hereinafter,the “private caches”). The processing system further implements a cacheat another level and which is shared among the processor cores of thecompute complex (hereinafter, the “shared cache”). The controller of theshared cache maintains address and state information for cachelines ofthe private caches in a shadow tag memory. This state informationincludes, for example, coherency information for the cacheline for eachof the private caches, as well as information regarding prior history ofthe cacheline at the private caches. Such coherency informationincludes, for example, an indicator of a coherency state from a set ofcoherency states that is a superset of the set of coherency statesimplemented by the private caches. With this shadow tag memory, theshared cache is able to filter probes sent to the private caches basedon lines present in the shadow tag memory. If a probed line is notpresent in the shadow tag memory, the probe does not need to be sent tothe private cache and thus is filtered out by the shared cache. Thisprobe filtering reduces probe traffic to the private caches within thecompute complex for probes that originate from within the computecomplex or between the compute complex and the system at large. In someembodiments, the shadow tag memory also tracks the state of cachelinesof the private caches with higher granularity, as well as process acacheline fill request from the private cache level and its associatedcacheline victim request more efficiently.

FIG. 1 illustrates a processing system 100 utilizing shadow tag memoryin accordance with at least some embodiments. In the depicted example,the processing system 100 includes a compute complex 102, a cachehierarchy 104, a memory controller 106, and a southbridge 108. Thecompute complex 102 includes a plurality of processor cores, such as thefour processor cores 111, 112, 113, 114 depicted in this example. Theprocessor cores comprise, for example, central processing unit (CPU)cores, graphics processing unit (GPU) cores, digital signal processor(DSP) cores, or a combination thereof. It will be appreciated that thenumber of processor cores of the compute complex 102 may be fewer ormore than four.

The memory controller 106 operates as the interface between the cachehierarchy 104 and a system memory 116. Thus, data to be cached in thecache hierarchy 104 typically is manipulated as blocks of data referredto as “cachelines”, and which are addressed or otherwise located in amemory hierarchy using a physical address of system memory 116.Cachelines are accessed from the system memory 116 by the memorycontroller 106 in response to memory requests from the cache hierarchy104. Likewise, when a cacheline containing modified data is evicted fromthe cache hierarchy 104 and thus needs to be updated in the systemmemory 116, the memory controller 106 manages this write-back process.The southbridge 108 operates as the interface between the cachehierarchy 104, the memory controller 106, and one or more peripherals118 of the processing system 100 (e.g., network interfaces, keyboards,mice, displays, and other input/output devices).

The cache hierarchy 104 includes two or more levels of caches. In theillustrated example, the cache hierarchy 104 includes three cachelevels: level 1 (L1); level 2 (L2), and level 3 (L3). For L1, the corecomplex 102 implements small private caches for each processing core,which are depicted as L1 caches 121, 122, 123, 124, each associated witha corresponding one of processor cores 111-114 as depicted in FIG. 1.

For L2, the core complex 102 implements larger private caches for eachprocessor core, which are depicted as L2 caches 131, 132, 133, 134corresponding to processor cores 111-114, respectively, as alsoillustrated in FIG. 1. Each of the L2 caches 131-134 is private to itscorresponding processor core, but the cache hierarchy 104 operates tomaintain coherency between the L2 caches 131-134. The L2 caches 131-134can be direct mapped or an n-way set associative cache in someembodiments.

For the L3 caching level, the cache hierarchy 104 implements an L3 cache140 that is shared by the processor cores of the compute complex 102,and thus shared by at least the L2 caches 131-134. The L3 cache 140implements an L3 controller 142, a L3 data array comprising a pluralityof indexes and a plurality of corresponding ways, each way to store acorresponding cacheline at the corresponding index, and an L3 tag arrayto store the tag information associated with each index/way. The L3 dataarray and L3 tag array are collectively illustrated, and referred toherein, as L3 data/tag array 144.

The L3 cache 140 further includes a shadow tag memory 146 to storeaddress and state information for cachelines of the L2 caches 131-134(that is, to store “shadow tags” representative of the tag informationof the L2 caches 131-134). To this end, the shadow tag memory 146 isimplemented as a cache, array, table, latches, flops, or other storageconfiguration so as to include shadow tag entries hierarchicallyarranged as a plurality of “banks”, a plurality of indices, and aplurality of ways. That is, each entry in the shadow tag memory 146corresponds to a particular bank, index and way combination. Each shadowtag entry in the shadow tag memory 146 tracks information for acorresponding cacheline present in one of the L2 caches 31-134. Theinformation stored at a shadow tag entry for the corresponding cachelineincludes, for example, the physical address (or portion thereof) of thecacheline as well as state of the cacheline at the L2 cache. Each bankcontains a plurality of indices and ways and represents the shadow tagentries used to track the cachelines present in one of the L2 caches.Thus, for the example of FIG. 1, the shadow tag memory 146 includes four“banks,” one for each of the four L2 caches 131-134.

To illustrate, FIG. 2 depicts an example implementation of the L3 cache140 in accordance with some embodiments. The L3 cache 140 is segmentedinto a plurality of “slices”, with the illustrated example having fourslices 201, 202, 203, 204 (also denoted as slices 1-4), and routinglogic 206 to route communications to and from the respective slicesbased on how the address associated with each communication is locatedwithin the slices 1-4. Each slice represents a corresponding “slice” ofthe distribution of addresses used by the L2 caches 131-134. Each slicealso represents corresponding “slice” of the shadow tag memory 146.Thus, as there are four slices in this example, each of slices 201-204stores a corresponding 25% of the address space of the L2 caches 131-134and a corresponding 25% of the entries of the shadow tag memory 146. Tothis end, as shown by the detailed view of slice 201, each sliceincludes an L3 data/tag slice 208, a shadow tag slice 210, and a slicecontroller 212. For slice 201, the L3 data/tag slice 208 has data andtag array entries for the first 25% of the L2 cache address range,whereas for slice 202 this is for the second 25% of the L2 cache addressrange, and so on. Similarly, for slice 201 the shadow tag slice 210includes the first 25% of the indices of the shadow tag memory 146, forslice 202 the shadow tag slice 210 includes the second 25% of theindices of the shadow tag memory 146, and so on.

FIG. 2 also depicts an example arrangement of the shadow tag memory 146in further detail. As noted, the shadow tag memory 146 is stored as aset of shadow tag slices 210, each having a corresponding portion of theoverall address range that is associated with the shadow tag memory 146.Thus, each shadow tag slice 210 includes a plurality of banks, indicesand ways. The number of banks in each shadow tag slice 210 correspondsto the number of L2 caches. Thus, because there are four L2 caches131-134 in the example of FIG. 1, each shadow tag slice 210 includesfour banks 221, 222, 223, 224 associated with L2 caches 131, 132, 133,134, respectively, in this example. The associativity (that is, thenumber of ways) of a bank is the same as the associativity of the L2cache associated with that bank. For example, if the L2 cache iseight-way associative, then each bank of the shadow tag memory 146 isalso eight-way associative, that is, has eight ways. Conversely, if theL2 cache is direct mapped, then each bank of shadow tag memory 146 isalso direct mapped; that is each bank effectively is a one-way setassociative cache. A particular combination of index and way in a givenbank represents a shadow tag entry 216 that tracks a correspondingcacheline that is present in L2 cache. Each entry of the shadow tagmemory 146 has an address field 214 to store at least a portion of anaddress (typically the upper bits of the physical address) of thecacheline associated with the entry 216 and a state field 215 to storestate information for the cacheline. The state and address informationstored in a corresponding entry 216 of the shadow tag memory 146 for acacheline of an L2 cache typically reflects at least a subset of the taginformation stored in the tag array of the L2 cache for that cacheline,and thus “shadows” the L2 cache's tag for this cacheline. As such, thestate information in the shadow tag memory 146 of the L3 cache 140 maybe viewed as “shadow tags” of the counterpart cacheline tags in the L2caches 131-134.

Table 1 below illustrates an example format and utilization of theshadow tag memory location 216 so as to represent the state informationfor a corresponding L2 cacheline.

TABLE 1 Shadow tag memory location Format Field Name No. of BitsDescription Valid 1 Indicates a valid entry. L2State[3:0] 4 Thecoherency state of the cacheline cached at the associated L2 cache.L3Alloc[1:0] 2 L3 allocation property for L2-victims- used to indicateif L2-victim should be cached in L3 or not. Value Meaning 00 Do notinstall L2- victim in L3. Treat these as L3-victim instead. 01 InstallL2-victim in L3. 10 Install L2-victim in L3. 11 Install L2-victim in L3.L2Tag[31:0] 32 The tag portion of the address of the cacheline cached inthe corresponding L2 cache.Thus, as shown by Table 1 the state information stored in the shadow tagentry 216 associated with a particular cacheline at a particular core/L2cache includes not only a copy of the tag portion of physical address ofthe cacheline at this L2 cache, but also coherency state information forthe cacheline, as well as allocation information to facilitate handlingof eviction of the cacheline from the L2 cache.

FIG. 3 illustrates the general operation and use of the shadow tagmemory 146 of the L3 cache 140 in accordance with some embodiments. Asillustrated by block 302, the L3 controller 142 monitors the operationof the L2 caches 131-134 (via, e.g., a coherence bus or other snoopmechanism) so as to identify changes in state for cachelines at the L2caches 131-134 and update the shadow tag memory 146 accordingly. Toillustrate, when a new cacheline is brought into the L2 caches 131-134,the L3 controller 142 identifies which of slices 201-204 is associatedwith the physical address of the cacheline, identifies an index and away of the shadow tag slice 210 of the identified slice, and updates theshadow tag entry 216 at the bank corresponding to the L2 cache toreflect the addition of this cacheline to the L2 cache. Similarly, whenthe state of a cacheline changes at the L2 caches 131-134, the L3controller 142 identifies which of the slices 201-204 is associated withthe cacheline, and then updates one shadow tag entry 216 at the bankcorresponding to the L2 cache at the shadow tag slice 210 of thisidentified slice to reflect the updated status of the cacheline.Eviction of a cacheline from the L2 caches 131-134 likewise triggers theL3 controller 142 to evict the cacheline from the shadow tag memory 146.

In some embodiments, the cache hierarchy 104 maintains the L2 and L3caching levels as exclusive caches—that is, a cacheline present in oneof the L2 caches 131-134 will not be present in the L3 cache 140, andvice versa. However, by maintaining, in effect, tag or other stateinformation at the shadow tag memory 146 of the L3 cache 140 forcachelines resident in the L2 caches 131-134 but without maintaining anyof the L2 cachelines at the L3 cache 140, the result is a hybridapproach whereby the L2 and L3 caching levels are data exclusive, buttag “inclusive”. That is, by maintaining state information for the L2cachelines in the shadow tag memory 146, the L3 cache 140 has visibilityinto the states of the L2 caches 131-134, and the coherency state of thedata stored therein, without having to store any of the actual dataassociated with the cachelines of the L2 caches 131-134. This L3-levelinsight into the cacheline status of the L2 caches enables a number ofadvantageous operations.

To illustrate, as represented by block 304, because the L3 cache 140 hasinformation regarding which cachelines are stored at the L2 caches131-134 (and the statuses of these cachelines), the L3 cache 140 iswell-suited to serve as a probe filter for cache probes to cachelinessubmitted by the memory controller 106, the southbridge 108, or othercomponents of the processing system 100 outside of the compute complex102. This probe filtering process is described in greater detail belowwith reference to FIG. 4. As another example, as represented by block306 the shadow tag information at the L3 cache 140 permits the L3 cache140 to implement L2 fill requests that also have an associated L2cacheline eviction request (hereinafter, an “L2 victim request”) as acombined request that avoids many of the pitfalls of handling both suchrequests in a conventional cache system. An example of this is describedin greater detail below with reference to FIG. 5. As yet anotherexample, block 308 represents a process by which the shadow tag memory146 at the L3 cache 140 is used to track the coherency of the L2cachelines with a finer granularity than applied at the L2 caches131-134, which reduces the number of system-level cache probes and thusimproves overall system performance. Examples of this finer-granularitycoherency state tracking are described below with reference to FIGS. 6and 7. Further, block 310 represents a process by which the shadow tagmemory 146 facilitates L3 victim processing, as described in greaterdetail below with reference to FIG. 8.

FIG. 4 illustrates a probe filter method 400 implemented by the L3 cache140 using the shadow tag memory 146 in accordance with at least oneembodiment. In a cache hierarchy, such as the cache hierarchy 104 of theprocessing system 100, cache probes are used to obtain cached data,inquire as to a state of cached data, change a state of cached data, orotherwise manipulate the cached data by potentially invalidating thecacheline from the cache. Cache probes that originate outside of thecompute complex 102 (that is, the processor cores 111-114, the L1 caches121-124, and the L2 caches 131-134) or the L3 cache 140 are referred toherein as “system cache probes.” These system cache probes may arrivefrom, for example, a different compute complex of the processing system100 via the memory controller 106, from a peripheral device 120 via thesouthbridge 108, and the like. Typically, such system cache probespropagate from the lowest level in the cache hierarchy (which is the L3caching level in this example). Accordingly, probe filter method 400illustrates the probe filter process for such system cache probes.

The method 400 initiates at block 402 with the receipt of a system cacheprobe by the L3 controller 142. In response to the cache probe, at block404 the L3 controller 142 checks the tags of the L3 data/tag array 144to determine whether a valid copy of the cacheline requested by thecache probe is present in the L3 cache 140 (that is, whether the cacheprobe hits on the L3 cache 140). If a valid copy of the requestedcacheline is present in the L3 cache 140, at block 406 the L3 controller142 signals a cache hit and services the cache probe from the L3 cache140.

Otherwise, if a valid copy of the requested cacheline is not present inthe L3 cache 140, at block 408 the L3 controller 142 searches the stateinformation of the shadow tag memory 146 to determine whether at leastone of the L2 caches stores a valid copy of the requested cacheline. Atblock 410 the L3 controller 142 analyzes the results of the search. Inthe event that the search of the shadow tag memory 146 reveals that noneof the L2 caches 131-136 contain a valid copy of the requestedcacheline, at block 412 the L3 controller 142 signals a cache miss inresponse to the cache probe. With this cache miss, the memory controller106 initiates a memory access to obtain the requested cacheline from thesystem memory 116. Otherwise, if the search of the shadow tag memory 146reveals that at least one L2 cache has a valid copy of the requestedcacheline, at block 414 an L2 cache having a valid copy is selected (inthe event that there is more than one L2 with a valid copy) and the L3controller 142 forwards the cache probe to the selected L2 cache. Whenthere are two or more L2 caches having a valid copy of the requestedcacheline, the L3 controller selects one of the L2 caches 131-134 forservicing the cache probe based on a comparison of coherency states ofthe two or more L2 caches as represented in the shadow tag memory 146.To illustrate, an L2 cache having a Forward (F) or Owned (O) coherencystate represented in the shadow tag memory 146 for the requestedcacheline is preferentially selected over the other L2 caches having avalid copy of the requested cacheline.

Thus, as method 400 illustrates, because the shadow tag memory 146enables the L3 controller 142 to know which cachelines are present andvalid in the L2 caches 131-134, in some embodiments the L3 controller142 preemptively signals a cache miss to system cache probes forcachelines not present (that is, not valid) in the L2 caches 131-134,and thus filter out cache probes that otherwise would have beenbroadcast to the L2 caches and returned with a L2 “cache miss,”indicating the absence of the cacheline in the L2 cache.

FIG. 5 illustrates a process for processing a coupled fill/victimtransaction at the L3 cache 140 using the shadow tag memory 146 inaccordance with some embodiments. As explained above, the L2 tag andstate bits for a cacheline resident in an L2 cache is maintained at thecorresponding shadow tag entry 216 located at the index associated withthe cacheline and the way associated with the L2 cache. When the L2cache sends a fill request to a particular L2 index and way, the fillrequest, depending on circumstances, triggers a capacity victim requestat the same L2 index and way. The state update of the shadow tag memory146 for this pair of requests (that is, the fill request paired with thecapacity victim request) could introduce unintended operations if thefill request and victim request are sent from the L2 cache to the L3cache as separate requests. The reason for this is that the queueimplemented by the L3 cache to buffer such requests might accept thefill request and not have any more free entries to accept the capacityvictim request from the L2 cache. The handling of the fill request andvictim request independently (without both being resident in the requestqueue) can lead to issues in updating the shadow tag memory 146 at theL2 index and way. As one example, if the fill request is completed whilethe capacity victim request remains unprocessed, a probe to the addressof the victim cacheline will miss in the shadow tag memory 146, and thusthe L3 controller will think that the L2 caches do not have a copy ofthe victim cacheline. As another example, if the fill request isprocessed while the capacity victim request remains unprocessed and thetag of the cacheline that is subject of the fill request has not yetbeen stored to the shadow tag memory 146, a probe to the address of thefill cacheline will miss in the shadow tag memory 146, and thus the L3controller will think that the L2 caches do not have a copy of the fillcacheline.

To avoid such issues, in at least one embodiment, the cache hierarchy104 may be configured so that the L2 caches 131-134 issue fill requeststhat have a resulting capacity victim request as a coupled fill/victimrequest 500 that includes both a fill request 502 and a correspondingvictim request 504 as a single request packet provided to the L3controller 142. A queue controller 506 of the L3 controller 142identifies the coupled fill/victim request 500 as such, and thusenqueues the coupled fill/victim request 500 as two separate entries,with the fill request 502 being enqueued in a fill request queue 508 andthe victim request being enqueued in a write request queue 510. Toensure successful enqueuing, the queue controller 506 does not enqueueeither request until it is confirmed that both queues 508, 510 have atleast one open entry. By receiving both requests 502, 504 in a singlerequest packet, and by ensuring that both requests are enqueued onlywhen there is room for each in their respective queues, any instance inwhich the fill request 502 is queued while the victim request 504 isdropped is avoided. As such, the fill request 502 and the victim request504 each can independently update the shadow tag memory 146.

To illustrate, if the fill request 502 is accessed from the queue 508and performed (as represented by fill processing 512) before the victimrequest 504 (for example, in the case of an L3 hit), in processing thefill request 502 the L3 controller 142 can overwrite the victim tag atthe shadow tag entry 216 that is indexed by the L2 index and way in theshadow tag memory 146. This is acceptable as any probe to the victimaddress in this time period would now interlock with the outstandingvictim request 504 in the queue 510. Conversely, if the victim request504 is accessed from the queue 510 and performed (as represented byvictim processing 514) before the fill request 502, it would beacceptable to clear out the tag information for the victim cacheline atthe corresponding index and way of the shadow tag memory 146 even thoughthe tag information for the fill cacheline has not yet been written tothe same location in the shadow tag memory 146.

In addition to facilitating effective probe filtering and accuratecoupled fill/victim request processing, in some embodiments the shadowtag memory 146 enables the L3 cache 140 to provide enhanced coherencyoperations for the cachelines stored at the L2 caches 131-134. To thisend, in some embodiments the L3 cache 140 implements a cache coherencyprotocol that is a superset of the cache coherency protocol implementedby the L2 caches 131-134. For example, the L2 caches 131-134 implement aMOESI (Modified-Owned-Exclusive-Shared-Invalid) coherency protocol,whereas the coherency states maintained by the L3 controller in theshadow tag memory 146 for the L2 caches 131-134 include, for example,the MOESI protocol along with additional coherency states that enablethe L3 controller to, for example, more efficiently process internal andsystem cache probes, while permitting the L2 caches 131-134 to use aless complex coherency protocol, and thus requiring less compleximplementation of the L2 caches 131-134 and less complex communicationsbetween the L2 caches 131-134 of the same compute complex 102.

FIGS. 6 and 7 illustrate two such examples of the superset coherencyprotocol implementation for the shadow tag memory 146. In particular,FIGS. 6 and 7 depict the use of additional coherency states that permitthe L3 controller 142 to recall that a particular cacheline is exclusivein nature from a coherency point of view or from the point of view ofthe memory controller 106, while still permitting the cacheline to beshared internally within the compute complex 102 in a manner that avoidscertain probes to the larger system when one of the cores requestsexclusive access to the cacheline.

FIG. 6 illustrates an example implementation in which the L3 cache 140implements an additional coherency state, denoted “Forward withexclusive” or “Fe” at the shadow tag memory 146. The Fe state is used atthe shadow tag memory 146 to record or otherwise remember that aprocessor core had exclusive access to a corresponding cacheline beforethat cacheline was shared with another core in the same compute complex102, and thus enabling the L3 controller 142 to handle any requests forexclusive access to that cacheline by another core (such requestsreferred to herein as a Change to Exclusive, or ChgToX, request)internally—that is, without necessitating probes to the system at large.

To illustrate by way of example, FIG. 6 depicts a sequence 600 of cacheaccess operations involving a particular cacheline (denoted “cachelineX”). The coherency state maintained for cacheline X at each of the L2caches 131-134 as the sequence 600 progresses is represented by the lanechart 602 on the left. The coherency state maintained for cacheline X inthe corresponding shadow tag entries 216 for each of the L2 caches131-134 at the shadow tag memory 146 as the sequence 600 progresses isrepresented by the lane chart 604 on the right. For purposes of thisexample, the L2 caches 131-134 utilize the MOESI coherency protocol,whereas the shadow tag memory 146 utilizes the Fe coherency state inaddition to the M, O, E, S, and I coherency states of the MOESIcoherency protocol (that is, “MOESI+”).

At time 0, cacheline X is not validly present in any of the L2 caches131-134, and thus the coherency status for cacheline X is marked I(invalid) in both the corresponding tags of the L2 caches 131-134 and inthe corresponding shadow tags (that is, in shadow tag entries 216) ofthe shadow tag memory 146. At time 1, the L2 cache 131 associated withprocessor core 111 issues a fill request 606 for cacheline X, and afterprocessing of the fill request has completed, the L2 cache 131 changesthe coherency state for cacheline X from “I” (invalid) to “E”(exclusive), and thus recording the fact that a new cacheline has beeninstalled in the L2 cache 131. Further, the L3 controller 142 notes thisresponse sent to request 606 and updates the shadow tag entry 216 of theshadow tag memory 146 for cacheline X and L2 cache 131 to also reflectthe E coherency state.

At time 2, processor core 112 issues a read request for cacheline X,which in turn triggers the L2 cache 132 associated with processor core112 to issue a fill request 608 for cacheline X. In response, the L3controller 142 processes the fill request by searching the shadow tagmemory 146 and identifies a “hit” in the shadow tag memory 146indicating that the L2 cache 131 has a copy of this cacheline. Inresponse, the L3 controller 142 sends a probe request to L2 cache 131and satisfies the fill request 608 by responding with the cacheline databack to L2 cache 132. This results in L2 cache 131 sharing its copy ofthe cacheline X, and the coherency controller at the L2 caching levelchanges the coherency states for the cacheline X at the L2 caches 131,132 both to the “S” (shared) coherency state. The L3 controller 142 hasto update the two shadow tag memory locations; one corresponding to thecacheline X being present in L2 cache 131 and one corresponding to thecacheline X that was just sent to L2 cache 132. However, rather thanchanging corresponding coherency states in the shadow tag memory 146 atboth these locations to the “S” state, the L3 controller 142 recognizesthat the coherency state for core 111 for cacheline X was “E” at thetime of this operation, and thus changes the “E” coherency state to the“Fe” coherency state for the L2 cache 131. As processor core 112 did nothave the “E” coherency state at the time of this change, the L3controller 142 changes the coherency state for cacheline X to “S” forthe L2 cache 132 in the shadow tag memory 146 to indicate that L2 cache132 is sharing the cacheline X.

Subsequently, at time 3 processor core 112 issues a request to obtainexclusive access to cacheline X, which in turn triggers the L2 cache 132to issue a ChgToX request 610. As shown by the coherency states in lanechart 602 at this point, the L2 caches 131, 132 have “S” states forcacheline X, and caches 133 and 134 have “I” states for cacheline X. Assuch, from the L2 coherency states none of the L2 caches appears to haveexclusive access to cacheline X at the time that the ChgToX request 610is issued. As such, in a conventional system, the ChgToX request 610would have to be propagated to the memory controller 106, which wouldthen broadcast back probes into any other compute complexes in theprocessing system 100 to determine whether a valid copy of cacheline Xis present elsewhere, and if so, invalidate any such copies so thatprocessor 1 can obtain exclusive access to cacheline X. This processthus results in considerable probe traffic throughout the system 100.However, the expanded L2 coherency state tracking afforded by the shadowtag memory 146 at the L3 cache 140 can reduce or eliminate such probetraffic.

To illustrate, because the L3 controller 142 marked the coherency stateof cacheline X for L2 cache 131 as Fe in the shadow tag memory 146, theL3 controller 142 is able to recognize that the processor core 111/L2cache 131 had exclusive access to cacheline X before it was sharedwithin the compute complex 102 (that is, shared with processor core112/L2 cache 132). From this information, it follows that cacheline Xwas not shared outside of the compute complex 102, and thus no validcopy of cacheline X is present outside of the compute complex 102. Assuch, in response to detecting the Fe coherency state for cacheline X inthe shadow tag memory 146, the L3 controller 142 is able to signal tothe L2 cache 132 that the L2 cache 132 can have exclusive access tocacheline X without the need to forward the ChgToX request 610 to thememory controller 106 and thus avoid the triggering of one or moreexternal probes to find and invalidate copies of the cacheline X outsideof the compute complex 102. In response to this signaling, the L2 caches131, 132 update their respective tags to reflect a change in coherencystate for cacheline X to states “I” and “E”, respectively. The L3controller 142 likewise makes the same change to the coherency statesfor the L2 caches 131, 132 in the shadow tag memory 146. Thus, asdemonstrated above, by using the Fe coherency state in the shadow tagmemory 146 to identify a core/L2 cache that had exclusive access to acacheline before it was shared within the compute complex 102, externalprobing can be reduced or eliminated when another core in that samecompute complex 102 subsequently requests exclusive access.

FIG. 7 illustrates an example implementation in which the L3 cache 140utilizes an additional coherency state, denoted “Owned-dirty” or “Od” atthe shadow tag memory 146. Like the Fe state, in some embodiments the Odstate is used at the shadow tag memory 146 to record or otherwiseremember that a processor core had exclusive access to a modified, or“dirty” copy of the cacheline shared with another core in the samecompute complex 102, and thus enabling the L3 controller 142 to handleany requests for exclusive access to that cacheline by another core(such requests referred to herein as a Change to Exclusive, or ChgToX,request) internally—that is, without necessitating probes to the systemat large.

To illustrate by way of example, FIG. 7 depicts a sequence 700 of cacheaccess operations involving a particular cacheline (denoted “cachelineX”). The coherency state maintained for cacheline X at each of the L2caches 131-134 as the sequence 700 progresses is represented by the lanechart 702 on the left. The coherency state maintained for cacheline X inthe corresponding shadow tag entries 216 for each of the L2 caches131-134 at the shadow tag memory 146 as the sequence 700 progresses isrepresented by the lane chart 704 on the right. In this example, the L2caches 131-134 utilize the MOESDI coherency protocol, whereas the shadowtag memory 146 utilizes the Od coherency state in addition to the M, O,E, S, and I coherency states of the MOESI coherency protocol (that is,“MOESI+”).

At time 0, cacheline X is not validly present in any of the L2 caches131-134, and thus the coherency status for cacheline X is marked I(invalid) in both the corresponding tags of the L2 caches 131-134 and inthe corresponding shadow tags (that is, in shadow tag entries 216) ofthe shadow tag memory 146. At time 1, the L2 cache 131 associated withprocessor core 111 issues a fill request 706 for cacheline X, and afterprocessing of the fill request has completed, the L2 cache 131 changesthe coherency state for cacheline X to “E” (exclusive). Further, the L3controller 142 notices this response sent to request 606 and the L3controller 142 updates the shadow tag memory location 216 of the shadowtag memory 146 for cacheline X and L2 cache 131 to also reflect the Ecoherency state.

At time 2, processor core 111 issues a write request 708 that modifiesthe copy of cacheline X resident in the L2 cache 131. In response, theprocessing system 100 changes the coherency state of cacheline X in theL2 cache 131 to the “M” (Modified) coherency state. Likewise, inresponse to detecting the modification to cacheline X at the L2 cache131, the L3 controller 142 updates the shadow tag memory 146 to reflectthe “M” coherency state for cacheline X at the L2 cache 131.

At time 3, processor core 112 issues a read request for cacheline X,which in turn triggers the L2 cache 132 associated with processor core112 to issue a fill request 710 for cacheline X. In response, the L3controller 142 processes the fill request by searching the shadow tagmemory 146 and identifies a “hit” in the shadow tag memory 146indicating that the L2 cache 131 has a copy of this cacheline. Inresponse, the L3 controller 142 sends a probe request to L2 cache 131and satisfies the fill request 608 by responding with the cacheline databack to L2 cache 132. This results in L2 cache 131 sharing its dirtycopy of the cacheline X with the L2 cache 132, and the coherencycontroller at the L2 caching level changes the coherency states for thecacheline X to the “S” (Shared) coherency state for L2 cache 131 and the“0” (Owned) coherency state for L2 cache 132. However, rather thanlikewise changing corresponding coherency states in the shadow tagmemory 146 in the same manner, the L3 controller 142 recognizes that thecoherency state for core 111 for cacheline X was “M” at the time of thisoperation, and thus marks cacheline X as having the “Od” coherency statefor the L2 cache 132. As such, the shadow tag memory 146 signals thatthe L2 cache 132 obtained access to a dirty copy of cacheline X fromanother core in the same compute complex 102.

Subsequently, at time 4 processor core 111 issues a request to obtainexclusive access to cacheline X, which in turn triggers the L2 cache 131to issue a ChgToX request 712. From the L2 coherency states at thispoint, it would not be clear whether an exclusive copy of cacheline X ispresent in any of the L2 caches 131-134. As such, in a conventionalsystem, the ChgToX request 712 would have to be propagated to the memorycontroller 106, which would then broadcast back probes into any othercompute complexes in the processing system 100 to determine whether acopy of cacheline X is present elsewhere, and if so, invalidate the copyso that core 111 in compute complex 102 can obtain exclusive access tocacheline X. This process would result in considerable probe trafficthroughout the system 100. However, because the L3 controller 142 markedthe coherency state of cacheline X for L2 cache 132 as Od in the shadowtag memory 146, the L3 controller 142 is able to recognize that theprocessor core 112/L2 cache 132 had exclusive access to cacheline Xbefore sharing the cacheline X with another core/L2 cache in the computecomplex 102. From this information, it follows that cacheline X was notshared outside of the compute complex 102, and thus no valid copy ofcacheline X is present outside of the compute complex 102. With thisinformation, the L3 controller 142 is able to signal to the L2 cache 131that the L2 cache 131 can have exclusive access to cacheline X withoutthe need to forward the ChgToX request 710 to the memory controller 106and thus avoid the triggering of one or more external probes to find andinvalidate copies of the cacheline X outside of the compute complex 102.In response to this signaling, the L2 caches 131, 132 update theirrespective tags to reflect a change in coherency state for cacheline Xto states “D” and “I”, respectively. The L3 controller 142 likewisemakes the same change to the coherency states for the L2 caches 131, 132in the shadow tag memory 146. Thus, as demonstrated above, by using theOd coherency state in the shadow tag memory 146 to identify a core/L2cache that had exclusive access to a cacheline before it was sharedwithin the compute complex 102, external probing can be eliminated whenanother core in that same compute complex 102 subsequently requestsexclusive access.

FIG. 8 illustrates a method 800 for efficient processing of cachelineevictions from the cache hierarchy 104 reported to memory controller 106using the shadow tag memory 146 in accordance with at least oneembodiment. At block 802, a new cacheline is received for storage at theL3 cache 140. The installation of a new cacheline in the L3 cache 140can sometimes result in the eviction of another existing cacheline atthe same location from the L3 cache 140. This eviction is termed “L3victim” for purposes of the following. Accordingly, at block 804 the L3controller 142 determines whether the new cacheline results in an L3victim. If not, no L3 victim processing is required, and thus the method800 terminates. However, if an L3 victim results, L3 victim processingis initiated. In some embodiments, the L2 caches 131-134 are implementedas inclusive caches and thus include all cachelines present in itscorresponding L1 caches 121-124. Accordingly, at block 808 the L3controller 142 searches shadow tag memory 146 to determine whether thesame cacheline exists in the shadow tag memory 146. If the L3 victim isin the shadow tag memory 146, the L3 controller 142 gets a “hit” fromthe search process and thus the L3 controller 142 determines that thecacheline exists in one of the L2 caches 131-134. Accordingly, inresponse to the hit, at block 810 the L3 controller 142 refrains fromany further processing of the L3 victim, including refraining fromreporting the L3 victim to the memory controller 106. If, however, a“miss” results from the shadow tag memory search, the L3 controller 142determines that the cacheline is not present in any of the L2 caches131-134. Accordingly, in response to a miss at block 812 the L3controller completes processing of the L3 victim, which includesreporting the L3 victim as an eviction from the cache hierarchy 104 tothe memory controller 106. Thus, implementation of the shadow tag memory146 enables the L3 cache 140 to eliminate requests for L3 victims to bereported to the memory controller 106 as eviction victims in instanceswhere the L3 victim cachelines are present in the L2 caches 131-134, andthus saving power and memory bandwidth in the design.

In some embodiments, the apparatus and techniques described above areimplemented in a system comprising one or more integrated circuit (IC)devices (also referred to as integrated circuit packages or microchips),such as the processing system 100 described above with reference toFIGS. 1-8. Electronic design automation (EDA) and computer aided design(CAD) software tools are used in the design and fabrication of these ICdevices. These design tools typically are represented as one or moresoftware programs. The one or more software programs comprise codeexecutable by a computer system to manipulate the computer system tooperate on code representative of circuitry of one or more IC devices soas to perform at least a portion of a process to design or adapt amanufacturing system to fabricate the circuitry. This code includesinstructions, data, or a combination of instructions and data. Thesoftware instructions representing a design tool or fabrication tooltypically are stored in a computer readable storage medium accessible tothe computing system. Likewise, the code representative of one or morephases of the design or fabrication of an IC device are stored in andaccessed from the same computer readable storage medium or a differentcomputer readable storage medium.

A computer readable storage medium includes any non-transitory storagemedium, or combination of non-transitory storage media, accessible by acomputer system during use to provide instructions and/or data to thecomputer system. Such storage media includes, but is not limited to,optical media (e.g., compact disc (CD), digital versatile disc (DVD),Blu-Ray disc), magnetic media (e.g., floppy disc, magnetic tape, ormagnetic hard drive), volatile memory (e.g., random access memory (RAM)or cache), non-volatile memory (e.g., read-only memory (ROM) or Flashmemory), or microelectromechanical systems (MEMS)-based storage media.The computer readable storage medium is embedded in the computing system(e.g., system RAM or ROM), fixedly attached to the computing system(e.g., a magnetic hard drive), removably attached to the computingsystem (e.g., an optical disc or Universal Serial Bus (USB)-based Flashmemory), or coupled to the computer system via a wired or wirelessnetwork (e.g., network accessible storage (NAS)).

In some embodiments, certain aspects of the techniques described aboveare implemented by one or more processors of a processing systemexecuting software. The software comprises one or more sets ofexecutable instructions stored or otherwise tangibly embodied on anon-transitory computer readable storage medium. The software includesthe instructions and certain data that, when executed by the one or moreprocessors, manipulate the one or more processors to perform one or moreaspects of the techniques described above. The non-transitory computerreadable storage medium includes, for example, a magnetic or opticaldisk storage device, solid state storage devices such as Flash memory, acache, random access memory (RAM) or other non-volatile memory device ordevices, and the like. The executable instructions stored on thenon-transitory computer readable storage medium is implemented in sourcecode, assembly language code, object code, or other instruction formatthat is interpreted or otherwise executable by one or more processors.

Note that not all of the activities or elements described above in thegeneral description are required, that a portion of a specific activityor device may not be required, and that one or more further activitiesare performed, or elements included, in addition to those described.Still further, the order in which activities are listed are notnecessarily the order in which they are performed. Also, the conceptshave been described with reference to specific embodiments. However, oneof ordinary skill in the art appreciates that various modifications andchanges can be made without departing from the scope of the presentdisclosure as set forth in the claims below. Accordingly, thespecification and figures are to be regarded in an illustrative ratherthan a restrictive sense, and all such modifications are intended to beincluded within the scope of the present disclosure.

Benefits, other advantages, and solutions to problems have beendescribed above with regard to specific embodiments. However, thebenefits, advantages, solutions to problems, and any feature(s) thatcause any benefit, advantage, or solution to occur or become morepronounced are not to be construed as a critical, required, or essentialfeature of any or all the claims. Moreover, the particular embodimentsdisclosed above are illustrative only, as the disclosed subject mattercan be modified and practiced in different but equivalent mannersapparent to those skilled in the art having the benefit of the teachingsherein. No limitations are intended to the details of construction ordesign herein shown, other than as described in the claims below. It istherefore evident that the particular embodiments disclosed above may bealtered or modified and all such variations are considered within thescope of the disclosed subject matter. Accordingly, the protectionsought herein is as set forth in the claims below.

What is claimed is:
 1. A processing system comprising: a plurality ofprocessor cores; a plurality of private caches, each private cacheassociated with a corresponding processor core of the plurality ofprocessor cores and comprising a corresponding set of cachelines, theplurality of private caches configured to store coherency states for thecachelines of the corresponding sets of cachelines in accordance with afirst set of coherency states; and a shared cache shared by theplurality of processor cores, the shared cache comprising: a second setof cachelines; and a shadow tag memory comprising a plurality ofentries, each entry storing state and address information for acorresponding cacheline of the set of cachelines of one of the privatecaches, the shadow tag memory configured to store coherency states forthe cachelines of the sets of cachelines of the plurality of privatecaches in accordance with a second set of coherency states, the secondset of coherency states comprising a superset of the first set ofcoherency states, wherein the state information comprises coherencystates for at least a subset of the cachelines of the plurality ofprivate caches in accordance with the second set of coherency states. 2.The processing system of claim 1, wherein the second set of coherencystates includes a coherency state that signals that an associatedcacheline was obtained from one of the plurality of private caches thathad exclusive access to the associated cacheline.
 3. The processingsystem of claim 1, wherein the second set of coherency states includes acoherency state that signals that an associated cacheline was obtainedin modified form from one of the plurality of private caches that hadexclusive access to the associated cacheline.
 4. The processing systemof claim 1, wherein the shared cache further comprises: a controller tofilter cache probes based on the shadow tag memory.
 5. The processingsystem of claim 4, wherein the controller is to filter cache probes by:searching the shadow tag memory to determine whether the shadow tagmemory has a valid entry for a cacheline associated with a cache probe;and responsive to determining the shadow tag memory does not have avalid entry for the cacheline, signaling a cache miss in response to thecache probe.
 6. The processing system of claim 4, wherein the controlleris to filter cache probes further by: responsive to determining theshadow tag memory has a valid entry for the cacheline, identifying theprivate cache associated with the valid entry and forwarding the cacheprobe to the identified private cache.
 7. The processing system of claim1, wherein: the plurality of private caches comprises a plurality oflevel 2 (L2) caches; and the shared cache comprises a level 3 (L3)cache.
 8. A processing system comprising: a plurality of processorcores; a plurality of private caches, each private cache associated witha corresponding processor core of the plurality of processor cores andcomprising a corresponding set of cachelines; and a shared cache sharedby the plurality of processor cores, the shared cache comprising: asecond set of cachelines: and a shadow tag memory comprising a pluralityof entries, each entry storing state and address information for acorresponding cacheline of the set of cachelines of one of the privatecaches wherein: responsive to determining that a fill request for aprivate cache will result in eviction of a victim cacheline from theprivate cache, the private cache is to transmit to the shared cache asingle request packet that identifies both the fill request to beperformed and a victim request to store the victim cacheline that is tobe evicted to the shared cache; and responsive to receiving the singlerequest packet, the shared cache is to buffer the fill request in a fillrequest queue and to buffer the victim request in a victim requestqueue.
 9. A method in a processing system including a plurality ofprivate caches associated with a plurality of processor cores and ashared cache shared by the plurality of processor cores, the methodcomprising: maintaining, at the plurality of private caches, coherencyinformation for cachelines stored at the plurality of private caches inaccordance with a first set of coherency states; and maintaining, at ashadow tag memory of the shared cache, coherency information for thecachelines stored at the plurality of private caches in accordance witha second set of coherency states, the second set of coherency statescomprising a superset of the first set of coherency states.
 10. Themethod of claim 9, wherein the second set of coherency states includes acoherency state that signals that an associated cacheline was obtainedfrom one of the plurality of private caches that had exclusive access tothe associated cacheline.
 11. The method of claim 9, wherein the secondset of coherency states includes a coherency state that signals that anassociated cacheline was obtained in modified form from one of theplurality of private caches that had exclusive access to the associatedcacheline.
 12. The method of claim 9, further comprising: filtering, atthe shared cache, cache probes based on the shadow tag memory.
 13. Themethod of claim 12, wherein filtering cache probes comprises: searchingthe shadow tag memory to determine whether the shadow tag memory has avalid entry for a cacheline associated with a cache probe; andresponsive to determining the shadow tag memory does not have a validentry for the cacheline, signaling a cache miss in response to the cacheprobe.
 14. The method of claim 13, wherein filtering cache probesfurther comprises: responsive to determining the shadow tag memory has avalid entry for the cacheline, identifying the private cache associatedwith the valid entry and forwarding the cache probe to the identifiedprivate cache.
 15. The method of claim 9, further comprising: responsiveto determining that a fill request for a private cache will result ineviction of a victim cacheline from the private cache, transmitting fromthe private cache to the shared cache a single request packet thatidentifies both the fill request to be performed and a victim request tostore the victim cacheline that is to be evicted to the shared cache;and responsive to receiving the single request packet, buffering, at theshared cache, the fill request in a fill request queue and buffering thevictim request in a victim request queue.
 16. The method of claim 9,further comprising: searching the shadow tag memory to determine whetherthe shadow tag memory has a valid entry for a cacheline being evictedfrom the shared cache; reporting the cacheline as being evicted to amemory controller responsive to determining there is no valid entry forthe cacheline; and refraining from reporting the cacheline as beingevicted to the memory controller responsive to determining there is avalid entry for the cacheline.
 17. A processing system comprising: aplurality of private caches, each private cache private to acorresponding processor core of a set of processor cores, each of theprivate caches configured to store coherency states for cachelines ofthe corresponding private cache in accordance with a first set ofcoherency states; and a shared cache shared by the set of processorcores, wherein the shared cache is maintained as data exclusive relativeto the plurality of private caches and tag inclusive relative to theplurality of private caches, wherein the shared cache comprises: ashadow tag memory that stores, in accordance with a second set ofcoherency states, state information representative of tag informationstored by the plurality of private caches, the second set of coherencystates comprising a superset of the first set of coherency states,wherein the state information comprises coherency states for at least asubset of the cachelines of the plurality of private caches.
 18. Theprocessing system of claim 17, wherein the second set of coherencystates includes a coherency state that signals that an associatedcacheline was obtained from one of the plurality of private caches thathad exclusive access to the associated cacheline.
 19. The processingsystem of claim 17, wherein the second set of coherency states includesa coherency state that signals that an associated cacheline was obtainedin modified form from one of the plurality of private caches that hadexclusive access to the associated cacheline.
 20. The processing systemof claim 17, wherein the shared cache further comprises: a controller tofilter cache probes based on the shadow tag memory.
 21. The processingsystem of claim 20, wherein the controller is to filter cache probes by:searching the shadow tag memory to determine whether the shadow tagmemory has a valid entry for a cacheline associated with a cache probe;and responsive to determining the shadow tag memory does not have avalid entry for the cacheline, signaling a cache miss in response to thecache probe.
 22. The processing system of claim 21, wherein thecontroller is to filter cache probes further by: responsive todetermining the shadow tag memory has a valid entry for the cacheline,identifying the private cache associated with the valid entry andforwarding the cache probe to the identified private cache.